package com.czmh.etc.onlinepubsys.utils.cmg;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONObject;
import com.czmh.etc.onlinepubsys.constants.cmg.BusinessType;
import com.czmh.etc.onlinepubsys.enums.cmg.ApiCodeEnum;
import com.czmh.etc.onlinepubsys.request.cmg.ApiRequestBase;
import com.czmh.etc.onlinepubsys.response.cmg.ApiResponseBase;
import com.czmh.etc.onlinepubsys.response.ue.ApiResponse;
import com.czmh.etc.onlinepubsys.utils.AESTools;
import lombok.Cleanup;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.time.DateFormatUtils;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.net.SocketException;
import java.net.SocketTimeoutException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Component
@Slf4j
public class CmgHttpUtil {

    public static String url;
    public static String accessno;
    public static String accessKey;

    public static String newurl;
    public static String toAccessNo;
    public static String newaccessKey;

    @Value("${cmg.url}")
    private String url0;
    @Value("${newcmg.url}")
    private String url1;
    @Value("${cmg.accessno}")
    private String accessno0;
    @Value("${newcmg.toAccessNo}")
    private String toAccessNo0;
    @Value("${cmg.accessKey}")
    private String accessKey0;
    @Value("${newcmg.accessKey}")
    private String accessKey1;

    @PostConstruct
    public void init() {
        url = url0;
        newurl = url1;
        accessno = accessno0;
        toAccessNo = toAccessNo0;
        accessKey = accessKey0;
        newaccessKey = accessKey1;
    }

    public static ApiResponseBase newpost(String businessType, Object reqData) {
        String params = JSON.toJSONString(reqData);
        String timestamp = DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss");
        ApiRequestBase apiRequestBase = new ApiRequestBase();
        apiRequestBase.setAccessNo(toAccessNo);
        apiRequestBase.setTimestamp(timestamp);
        ApiResponseBase result = null;
        try {
            apiRequestBase.setBizContent(params);
            //以下通过判断请求路径去掉对应的图片base64信息，方便打印日志
            if (businessType.equalsIgnoreCase(BusinessType.AGENT_PREADD)) {
                JSONObject jsonObject = JSON.parseObject(apiRequestBase.getBizContent());
                jsonObject.put("agentFrontImgUrl", "");
                jsonObject.put("agentBackImgUrl", "");
                ApiRequestBase requestBase = new ApiRequestBase();
                requestBase.setBizContent(jsonObject.toJSONString());
                log.info("招商局业务号:{}, 参数:{}", url + businessType + "--" + getBusinessNote(businessType), JSON.toJSONString(requestBase));
            } else if (businessType.equalsIgnoreCase(BusinessType.CUSTOMER_PREADD)) {
                JSONObject jsonObject = JSON.parseObject(apiRequestBase.getBizContent());
                jsonObject.put("picData", "");
                jsonObject.put("picData2", "");
                ApiRequestBase requestBase = new ApiRequestBase();
                requestBase.setBizContent(jsonObject.toJSONString());
                log.info("招商局业务号:{}, 参数:{}", url + businessType + "--" + getBusinessNote(businessType), JSON.toJSONString(requestBase));
            } else if (businessType.equalsIgnoreCase(BusinessType.VEHICLE_PREADD)) {
                JSONObject jsonObject = JSON.parseObject(apiRequestBase.getBizContent());
                jsonObject.put("picData", "");
                jsonObject.put("picData2", "");
                jsonObject.put("picData3", "");
                ApiRequestBase requestBase = new ApiRequestBase();
                requestBase.setBizContent(jsonObject.toJSONString());
                log.info("招商局业务号:{}, 参数:{}", url + businessType + "--" + getBusinessNote(businessType), JSON.toJSONString(requestBase));
            } else if (businessType.equalsIgnoreCase(BusinessType.UPDATE_VEHICLE)) {
                JSONObject jsonObject = JSON.parseObject(apiRequestBase.getBizContent());
                jsonObject.put("picData", "");
                jsonObject.put("picData2", "");
                jsonObject.put("picData3", "");
                ApiRequestBase requestBase = new ApiRequestBase();
                requestBase.setBizContent(jsonObject.toJSONString());
                log.info("招商局业务号:{}, 参数:{}", url + businessType + "--" + getBusinessNote(businessType), JSON.toJSONString(requestBase));
            } else if (businessType.equalsIgnoreCase(BusinessType.ISSUE_ACTIVE_UPLOAD_PIC)) {
                JSONObject jsonObject = JSON.parseObject(apiRequestBase.getBizContent());
                jsonObject.put("picData", "");
                ApiRequestBase requestBase = new ApiRequestBase();
                requestBase.setBizContent(jsonObject.toJSONString());
                log.info("招商局业务号:{}, 参数:{}", url + businessType + "--" + getBusinessNote(businessType), JSON.toJSONString(requestBase));
            } else if (businessType.equalsIgnoreCase(BusinessType.ISSUE_VEHOWN_ADD_PIC)) {
                JSONObject jsonObject = JSON.parseObject(apiRequestBase.getBizContent());
                jsonObject.put("picData", "");
                jsonObject.put("picData2", "");
                ApiRequestBase requestBase = new ApiRequestBase();
                requestBase.setBizContent(jsonObject.toJSONString());
                log.info("招商局业务号:{}, 参数:{}", url + businessType + "--" + getBusinessNote(businessType), JSON.toJSONString(requestBase));
            } else if (businessType.equalsIgnoreCase(BusinessType.ISSUE_VEHOWN_UPDATE)) {
                JSONObject jsonObject = JSON.parseObject(apiRequestBase.getBizContent());
                jsonObject.put("picData", "");
                jsonObject.put("picData2", "");
                ApiRequestBase requestBase = new ApiRequestBase();
                requestBase.setBizContent(jsonObject.toJSONString());
                log.info("招商局业务号:{}, 参数:{}", url + businessType + "--" + getBusinessNote(businessType), JSON.toJSONString(requestBase));
            } else {
                log.info("招商局业务号:{}, 参数:{}", url + businessType + "--" + getBusinessNote(businessType), JSON.toJSONString(apiRequestBase));
            }
            params = AESTools.encrypt(params, newaccessKey, "UTF-8");
            apiRequestBase.setBizContent(params);
            // 响应模型
            @Cleanup
            CloseableHttpClient httpClient = HttpClientBuilder.create().build();
            // 创建Post请求
            HttpPost httpPost = new HttpPost(newurl + businessType);

            List<NameValuePair> param = new ArrayList<>();
            param.add(new BasicNameValuePair("accessNo", toAccessNo));
            param.add(new BasicNameValuePair("bizContent", apiRequestBase.getBizContent()));
            param.add(new BasicNameValuePair("charset", apiRequestBase.getCharset()));
            param.add(new BasicNameValuePair("encryptType", apiRequestBase.getEncryptType()));
            param.add(new BasicNameValuePair("encryAesKey", ""));
            param.add(new BasicNameValuePair("format", apiRequestBase.getFormat()));
            param.add(new BasicNameValuePair("timestamp", apiRequestBase.getTimestamp()));
            param.add(new BasicNameValuePair("version", apiRequestBase.getVersion()));

            UrlEncodedFormEntity entity = new UrlEncodedFormEntity(param, "UTF-8");
            httpPost.setEntity(entity);
            httpPost.addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36");
            RequestConfig config = RequestConfig.custom().setSocketTimeout(60000)
                    .setConnectTimeout(60000).build();
            httpPost.setConfig(config);

            // 由客户端执行(发送)Post请求
            @Cleanup
            CloseableHttpResponse response = httpClient.execute(httpPost);

            // 从响应模型中获取响应实体
            HttpEntity responseEntity = response.getEntity();
            if (responseEntity != null && response.getStatusLine().getStatusCode() == 200) {
                String text = EntityUtils.toString(responseEntity, "UTF-8");
                result = JSON.parseObject(text, ApiResponseBase.class);
                if (result.getBizContent() != null) {
                    result.setBizContent(AESTools.decrypt(result.getBizContent(), newaccessKey, "UTF-8"));
                }
                log.info("招商局业务号:{},响应:{}", getBusinessNote(businessType) + "---" + businessType, JSON.toJSONString(result));
            } else if (responseEntity != null) {
                String text = EntityUtils.toString(responseEntity, "UTF-8");
                try {
                    result = JSON.parseObject(text, ApiResponseBase.class);
                } catch (JSONException exception) {
                    log.error("招商局业务号:{},返回解析出错:{}", getBusinessNote(businessType) + "---" + businessType, text);
                    throw exception;
                }
                log.info("招商局业务号:{},响应:{}", getBusinessNote(businessType) + "---" + businessType, JSON.toJSONString(result));
            }
            return result;
        } catch (JSONException exception) {
            log.error("招商局返回解析出错", exception.getMessage());
            ApiResponseBase r = new ApiResponseBase();
            r.setCode(ApiCodeEnum.FAIL.getCode());
            r.setMsg("解析出错,请稍后再试！");
            r.setReceiveTime("" + System.currentTimeMillis());
            return r;
        } catch (SocketTimeoutException exception) {
            log.error("招商局请求超时", exception);
            ApiResponseBase r = new ApiResponseBase();
            r.setCode(ApiCodeEnum.SOCKET_TIME_OUT.getCode());
            r.setMsg(ApiCodeEnum.SOCKET_TIME_OUT.getDesc());
            r.setReceiveTime("" + System.currentTimeMillis());
            return r;
        } catch (SocketException exception) {
            log.error("招商局连接失败", exception);
            ApiResponseBase r = new ApiResponseBase();
            r.setCode(ApiCodeEnum.CONNECTION_REST.getCode());
            r.setMsg(ApiCodeEnum.CONNECTION_REST.getDesc());
            r.setReceiveTime("" + System.currentTimeMillis());
            return r;
        } catch (Exception e) {
            log.error("招商局请求失败:{}", e.getMessage());
            throw new RuntimeException(e);
        }
    }

    public static ApiResponseBase post(String businessType, Object reqData) {
        String params = JSON.toJSONString(reqData);
        String timestamp = DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss");
        ApiRequestBase apiRequestBase = new ApiRequestBase();
        apiRequestBase.setAccessNo(accessno);
        apiRequestBase.setTimestamp(timestamp);
        ApiResponseBase result = null;
        try {
            apiRequestBase.setBizContent(params);
            //以下通过判断请求路径去掉对应的图片base64信息，方便打印日志
            if (businessType.equalsIgnoreCase(BusinessType.ADD_AGENT)) {
                JSONObject jsonObject = JSON.parseObject(apiRequestBase.getBizContent());
                jsonObject.put("agentFrontImgUrl", "");
                jsonObject.put("agentBackImgUrl", "");
                ApiRequestBase requestBase = new ApiRequestBase();
                requestBase.setBizContent(jsonObject.toJSONString());
                log.info("招商局业务号:{}, 参数:{}", url + businessType + "--" + getBusinessNote(businessType), JSON.toJSONString(requestBase));
            } else if (businessType.equalsIgnoreCase(BusinessType.ADD_CUSTOMER_INFO)) {
                JSONObject jsonObject = JSON.parseObject(apiRequestBase.getBizContent());
                jsonObject.put("picData", "");
                jsonObject.put("picData2", "");
                ApiRequestBase requestBase = new ApiRequestBase();
                requestBase.setBizContent(jsonObject.toJSONString());
                log.info("招商局业务号:{}, 参数:{}", url + businessType + "--" + getBusinessNote(businessType), JSON.toJSONString(requestBase));
            } else if (businessType.equalsIgnoreCase(BusinessType.ADD_VEHICLE)) {
                JSONObject jsonObject = JSON.parseObject(apiRequestBase.getBizContent());
                jsonObject.put("picData", "");
                jsonObject.put("picData2", "");
                jsonObject.put("picData3", "");
                ApiRequestBase requestBase = new ApiRequestBase();
                requestBase.setBizContent(jsonObject.toJSONString());
                log.info("招商局业务号:{}, 参数:{}", url + businessType + "--" + getBusinessNote(businessType), JSON.toJSONString(requestBase));
            } else if (businessType.equalsIgnoreCase(BusinessType.UPDATE_VEHICLE)) {
                JSONObject jsonObject = JSON.parseObject(apiRequestBase.getBizContent());
                jsonObject.put("picData", "");
                jsonObject.put("picData2", "");
                jsonObject.put("picData3", "");
                ApiRequestBase requestBase = new ApiRequestBase();
                requestBase.setBizContent(jsonObject.toJSONString());
                log.info("招商局业务号:{}, 参数:{}", url + businessType + "--" + getBusinessNote(businessType), JSON.toJSONString(requestBase));
            } else if (businessType.equalsIgnoreCase(BusinessType.ISSUE_ACTIVE_UPLOAD_PIC)) {
                JSONObject jsonObject = JSON.parseObject(apiRequestBase.getBizContent());
                jsonObject.put("picData", "");
                ApiRequestBase requestBase = new ApiRequestBase();
                requestBase.setBizContent(jsonObject.toJSONString());
                log.info("招商局业务号:{}, 参数:{}", url + businessType + "--" + getBusinessNote(businessType), JSON.toJSONString(requestBase));
            } else if (businessType.equalsIgnoreCase(BusinessType.ISSUE_VEHOWN_ADD_PIC)) {
                JSONObject jsonObject = JSON.parseObject(apiRequestBase.getBizContent());
                jsonObject.put("picData", "");
                jsonObject.put("picData2", "");
                ApiRequestBase requestBase = new ApiRequestBase();
                requestBase.setBizContent(jsonObject.toJSONString());
                log.info("招商局业务号:{}, 参数:{}", url + businessType + "--" + getBusinessNote(businessType), JSON.toJSONString(requestBase));
            } else if (businessType.equalsIgnoreCase(BusinessType.ISSUE_VEHOWN_UPDATE)) {
                JSONObject jsonObject = JSON.parseObject(apiRequestBase.getBizContent());
                jsonObject.put("picData", "");
                jsonObject.put("picData2", "");
                ApiRequestBase requestBase = new ApiRequestBase();
                requestBase.setBizContent(jsonObject.toJSONString());
                log.info("招商局业务号:{}, 参数:{}", url + businessType + "--" + getBusinessNote(businessType), JSON.toJSONString(requestBase));
            } else {
                log.info("招商局业务号:{}, 参数:{}", url + businessType + "--" + getBusinessNote(businessType), JSON.toJSONString(apiRequestBase));
            }
            params = AESTools.encrypt(params, accessKey, "UTF-8");
            apiRequestBase.setBizContent(params);
            // 响应模型
            @Cleanup
            CloseableHttpClient httpClient = HttpClientBuilder.create().build();
            // 创建Post请求
            HttpPost httpPost = new HttpPost(url + businessType);

            List<NameValuePair> param = new ArrayList<>();
            param.add(new BasicNameValuePair("accessNo", accessno));
            param.add(new BasicNameValuePair("bizContent", apiRequestBase.getBizContent()));
            param.add(new BasicNameValuePair("charset", apiRequestBase.getCharset()));
            param.add(new BasicNameValuePair("encryptType", apiRequestBase.getEncryptType()));
            param.add(new BasicNameValuePair("encryAesKey", ""));
            param.add(new BasicNameValuePair("format", apiRequestBase.getFormat()));
            param.add(new BasicNameValuePair("timestamp", apiRequestBase.getTimestamp()));
            param.add(new BasicNameValuePair("version", apiRequestBase.getVersion()));

            UrlEncodedFormEntity entity = new UrlEncodedFormEntity(param, "UTF-8");
            httpPost.setEntity(entity);
            httpPost.addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Safari/537.36");
            RequestConfig config = RequestConfig.custom().setSocketTimeout(60000)
                    .setConnectTimeout(60000).build();
            httpPost.setConfig(config);

            // 由客户端执行(发送)Post请求
            @Cleanup
            CloseableHttpResponse response = httpClient.execute(httpPost);

            // 从响应模型中获取响应实体
            HttpEntity responseEntity = response.getEntity();
            if (responseEntity != null && response.getStatusLine().getStatusCode() == 200) {
                String text = EntityUtils.toString(responseEntity, "UTF-8");
                result = JSON.parseObject(text, ApiResponseBase.class);
                if (result.getBizContent() != null) {
                    result.setBizContent(AESTools.decrypt(result.getBizContent(), accessKey, "UTF-8"));
                }
                log.info("招商局业务号:{},响应:{}", getBusinessNote(businessType) + "---" + businessType, JSON.toJSONString(result));
            } else if (responseEntity != null) {
                String text = EntityUtils.toString(responseEntity, "UTF-8");
                try {
                    result = JSON.parseObject(text, ApiResponseBase.class);
                } catch (JSONException exception) {
                    log.error("招商局业务号:{},返回解析出错:{}", getBusinessNote(businessType) + "---" + businessType, text);
                    throw exception;
                }
                log.info("招商局业务号:{},响应:{}", getBusinessNote(businessType) + "---" + businessType, JSON.toJSONString(result));
            }
            return result;
        } catch (JSONException exception) {
            log.error("招商局返回解析出错", exception.getMessage());
            ApiResponseBase r = new ApiResponseBase();
            r.setCode(ApiCodeEnum.FAIL.getCode());
            r.setMsg("解析出错,请稍后再试！");
            r.setReceiveTime("" + System.currentTimeMillis());
            return r;
        } catch (SocketTimeoutException exception) {
            log.error("招商局请求超时", exception);
            ApiResponseBase r = new ApiResponseBase();
            r.setCode(ApiCodeEnum.SOCKET_TIME_OUT.getCode());
            r.setMsg(ApiCodeEnum.SOCKET_TIME_OUT.getDesc());
            r.setReceiveTime("" + System.currentTimeMillis());
            return r;
        } catch (SocketException exception) {
            log.error("招商局连接失败", exception);
            ApiResponseBase r = new ApiResponseBase();
            r.setCode(ApiCodeEnum.CONNECTION_REST.getCode());
            r.setMsg(ApiCodeEnum.CONNECTION_REST.getDesc());
            r.setReceiveTime("" + System.currentTimeMillis());
            return r;
        } catch (Exception e) {
            log.error("招商局请求失败:{}", e.getMessage());
            throw new RuntimeException(e);
        }
    }

    /**
     * 根据业务号获取业务描述
     *
     * @param businessType
     * @return
     */
    public static String getBusinessNote(String businessType) {
        if (businessType.equalsIgnoreCase(BusinessType.ISSUE_ORG_CHANGE_LIST)) {
            return "通知发行渠道变更列表";
        } else if (businessType.equalsIgnoreCase(BusinessType.ISSUE_VEHOWN_ADD_PIC)) {
            return "车主图片上传";
        } else if (businessType.equalsIgnoreCase(BusinessType.ISSUE_VEHOWN_UPDATE)) {
            return "车主信息修改";
        } else if (businessType.equalsIgnoreCase(BusinessType.ISSUE_AGENT_UPDATE)) {
            return "修改经办人信息";
        } else if (businessType.equalsIgnoreCase(BusinessType.QUERY_CUSTOMER_INFO)) {
            return "查询ETC客户信息";
        } else if (businessType.equalsIgnoreCase(BusinessType.ADD_CUSTOMER_INFO)) {
            return "录入ETC客户信息";
        } else if (businessType.equalsIgnoreCase(BusinessType.ADD_OR_UPDATE_BANK_SIGN)) {
            return "录入线下银行签约信息接口";
        } else if (businessType.equalsIgnoreCase(BusinessType.ADD_VEHICLE)) {
            return "车辆信息录入接口";
        } else if (businessType.equalsIgnoreCase(BusinessType.ADD_AGENT)) {
            return "录入经办人信息";
        } else if (businessType.equalsIgnoreCase(BusinessType.CANCEL_BUSINESS)) {
            return "业务单取消接口";
        } else if (businessType.equalsIgnoreCase(BusinessType.CHECK_VEHILCE)) {
            return "车辆卡签校验查询接口(本省)";
        } else if (businessType.equalsIgnoreCase(BusinessType.CHECK_AND_QUERY_VEHILCE)) {
            return "车辆卡签校验查询接口(全国和本省)";
        } else if (businessType.equalsIgnoreCase(BusinessType.GET_BUSINESS_DETAIL)) {
            return "申办订单详情";
        } else if (businessType.equalsIgnoreCase(BusinessType.QUERY_VEHILCE)) {
            return "车辆信息查询接口";
        } else if (businessType.equalsIgnoreCase(BusinessType.SUBMIT_BUSINESS)) {
            return "申办订单提交";
        } else if (businessType.equalsIgnoreCase(BusinessType.UPDATE_VEHICLE)) {
            return "更新车辆信息接口";
        } else if (businessType.equalsIgnoreCase(BusinessType.UPDATE_CUSTOMER_INFO)) {
            return "更新ETC客户信息";
        } else if (businessType.equalsIgnoreCase(BusinessType.CARD_DECRYPT)) {
            return "车辆信息解密";
        } else if (businessType.equalsIgnoreCase(BusinessType.ISSUE_ACTIVECONFIRM_CARD)) {
            return "写卡成功确认";
        } else if (businessType.equalsIgnoreCase(BusinessType.ISSUE_ACTIVE_CONFIRM_OBU)) {
            return "写OBU成功确认";
        } else if (businessType.equalsIgnoreCase(BusinessType.ISSUE_ACTIVE_QUERY)) {
            return "卡签发行状态查询";
        } else if (businessType.equalsIgnoreCase(BusinessType.RE_ACTIVE_CONFIRM)) {
            return "OBU脱落激活确认";
        } else if (businessType.equalsIgnoreCase(BusinessType.RE_ACTIVE_OBU)) {
            return "获取脱落激活指令";
        } else if (businessType.equalsIgnoreCase(BusinessType.ISSUE_ACTIVE_SEND_MSG)) {
            return "发送卡签发行激活校验短信";
        } else if (businessType.equalsIgnoreCase(BusinessType.ISSUE_ACTIVE_UPLOAD_PIC)) {
            return "发行激活上传图片";
        } else if (businessType.equalsIgnoreCase(BusinessType.ISSUE_ACTIVE_VERIFY_MSG)) {
            return "卡签验证码校验";
        } else if (businessType.equalsIgnoreCase(BusinessType.ISSUE_ACTIVE_WRITE0015)) {
            return "获取卡片0015文件写卡指令接口";
        } else if (businessType.equalsIgnoreCase(BusinessType.ISSUE_ACTIVE_WRITE0016)) {
            return "获取卡片0016文件写卡指令接口";
        } else if (businessType.equalsIgnoreCase(BusinessType.ISSUE_ACTIVE_WRITE_SYSTEM)) {
            return "获取写系统信息指令";
        } else if (businessType.equalsIgnoreCase(BusinessType.ISSUE_ACTIVE_BIND_CAR_OBU)) {
            return "卡签发行绑定接口";
        } else if (businessType.equalsIgnoreCase(BusinessType.ISSUE_ACTIVE_WRITE_VEHICLE)) {
            return "获取写车辆信息指令";
        } else if (businessType.equalsIgnoreCase(BusinessType.CARD_LOSS_OPERATION)) {
            return "卡片挂失/解挂接口";
        } else if (businessType.equalsIgnoreCase(BusinessType.CARD_OBU_CANCEL)) {
            return "卡签注销提交接口";
        } else if (businessType.equalsIgnoreCase(BusinessType.CARD_REPLACE_SUBMIT)) {
            return "卡片更换提交接口";
        } else if (businessType.equalsIgnoreCase(BusinessType.AFTER_SALE_CANCEL)) {
            return "售后取消接口";
        } else if (businessType.equalsIgnoreCase(BusinessType.GET_AFTER_SALE_RECORD_DETAIL)) {
            return "ETC售后记录接口";
        } else if (businessType.equalsIgnoreCase(BusinessType.GET_AFTER_SALE_RECORD_LIST)) {
            return "ETC售后记录列表接口";
        } else if (businessType.equalsIgnoreCase(BusinessType.AFTER_SALE_SEND_MSG)) {
            return "卡签售后验证码发送接口";
        } else if (businessType.equalsIgnoreCase(BusinessType.OBU_REPLACE_SUBMIT)) {
            return "标签更换提交接口";
        } else if (businessType.equalsIgnoreCase(BusinessType.QUERY_CARD_OBU_INFO)) {
            return "查询卡签信息接口";
        } else if (businessType.equalsIgnoreCase(BusinessType.AFTER_SALE_VERIFY_MSG)) {
            return "卡签验证码校验接口";
        } else if (businessType.equalsIgnoreCase(BusinessType.AUTH_GET_TOKEN)) {
            return "获取授权访问token";
        } else if (businessType.equalsIgnoreCase(BusinessType.SIGN_CONFIRM_ONLINE)) {
            return "线上银行签约确认";
        } else if (businessType.equalsIgnoreCase(BusinessType.SIGN_APPLY_ONLINE)) {
            return "线上银行签约申请";
        } else {
            return "";
        }
    }

}
